package cn.xsly.ymcc.fegin;

import cn.xsly.ymcc.domain.Login;
import cn.xsly.ymcc.result.JSONResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class LoginFeginFactory implements FallbackFactory<LoginFeginClient> {
    @Override
    public LoginFeginClient create(Throwable cause) {
        return new LoginFeginClient() {
            @Override
            public JSONResult save(Login login) {
                cause.printStackTrace();
                return JSONResult.error("认证服务不可用");
            }
        };

    }
}
